package com.iplatform.commons.exception;


import com.iplatform.commons.exception.handler.GlobalException;

/**
 * 自定义异常
 */
public class CustomException extends GlobalException {
	private static final long serialVersionUID = 1L;
	private final String message;
	private Integer code;
	
	public CustomException(int returnCode, String returnMessage, Integer code, String message) {
		super(returnCode, returnMessage);
		this.code = code;
		this.message = message;
	}
	
	public CustomException(Integer code, String message) {
		super(code, message);
		this.code = code;
		this.message = message;
	}
	
	public CustomException(String message, Integer code) {
		super(code, message);
		this.code = code;
		this.message = message;
	}
	
	public CustomException(String message) {
		super(message);
		this.message = message;
	}
	
	public CustomException(String message, Throwable e) {
		super(message, e);
		this.message = message;
	}
	
	@Override
	public String getMessage() {
		return message;
	}
	
	public Integer getCode() {
		return code;
	}
}
